import sys

from sympy import root
sys.path.append('F:\\python36\\Lib\\site-packages')

import pymysql

host='localhost'
port=3306
db='myoj-test'
user='root'
password='root'
_conn=pymysql.connect(host=host,port=port,db=db,user=user,password=password)
def get_connection():
    return _conn

#从数据库中去除客户登录信息样例
def getAccountCases():
    conn=get_connection()
    cursor=conn.cursor((pymysql.cursors.DictCursor))
    cursor.execute("SELECT * FROM accounts")
    
    data=cursor.fetchall()
    
    cursor.close()
    
    return data

if __name__=='__main__':
    getAccountCases()